TGraph* sigplot(TFile* sig, TFile* bkg, char* plot, float lumi=1.0, float cxn=1.0, float nevt=1.0)
{
  TH1F* psig=(TH1F*) sig->Get(plot);
  TH1F* pbkg=(TH1F*) bkg->Get(plot);
  
  int n=psig->GetNbinsX();
  float incre =psig->GetXaxis()->GetXmax()/n;

  psig->Scale(lumi*cxn/nevt);

  float cut=incre;
  vector<double> v_cut, v_sig;
  for(int i=0; i<n; i++)
    {
      v_cut.push_back(cut);
      v_sig.push_back(psig->Integral(i+1, n+1)/
		      sqrt(pbkg->Integral(i+1,n+1) +1.0e-10));
      cut+=incre;
    }

  TGraph* a=new TGraph(v_cut.size(), &v_cut[0], &v_sig[0]);
  return a;
}
